<head>
<meta http-equiv='content-type' content='text/html; charset=utf8' />
<title>jsgoo core tests</title><link rel='stylesheet' href='main.css' type='text/css' />
<script type='text/javascript' src='jsgoo.js'></script>
<script type='text/javascript'>

function test() { _.$into('main', _test.go([
        {   n: 'map', 
            f: function(){ return _c.map(function(a){ return a + 1000 }, [ 1, 2, 3 ]); }, 
            r: [ 1001, 1002, 1003 ] },
			
        {   n: 'reduce: sum', 
            f: function(){ return _c.reduce(function(s, a){ return s + a }, [ 1, 2, 3 ], 0); }, 
            r: 6 },
			
        {   n: 'reduce: str', 
            f: function(){ return _c.reduce(function(s, a){ return s + a }, [ "aa", "bb", "cc" ], ""); }, 
            r: "aabbcc" },
			
        {   n: 'doeach', 
            f: function(){
                var str = "";
                _c.doeach(function(s, a){ str += s }, [ "11", "22", "33" ], "");
                return str;
            }, 
            r: "112233" },
			
        {   n: 'seek', 
            f: function(){ return _c.seek(function(v, i){ return v>4?v:false; }, [ 1,2,4,6,7 ]); }, 
            r: 6 },

		{   n: 'seek: false', 
            f: function(){ return _c.seek(function(v, i){ return v>10?v:false; }, [ 1,2,4,6,7 ]); }, 
            r: false },
			
        {   n: 'has', 
            f: function(){ return _c.has("bb", [ "aa", "bb", "cc" ]); }, 
            r: true },
			
        {   n: 'has: false', 
            f: function(){ return _c.has("dd", [ "aa", "bb", "cc" ]); }, 
            r: false },

		{   n: 'apply', 
            f: function(){ return _c.apply({name: "Mimi", age: 20}, {
					name: function(v,n){return n+": "+v},
					age:  function(v,n){return v+1} 
				}) }, 
            r: {name: "name: Mimi", age: 21} },
			
		{   n: 'apply', 
            f: function(){ return _c.apply({name: "Mimi", age: 20}, {
					name: function(v,n){return n+": "+v},
					age:  function(v,n){return v+1} 
				}) }, 
            r: {name: "name: Mimi", age: 21} },
			
		{   n: 'applyL', 
            f: function(){ return _c.applyL(
					[{name: "jim", age: 30},{name: "mimi", age: 20}], 
					{
						name: function(v,n){return v.toUpperCase()},
						age:  function(v,n){return v+1} 
					}) }, 
            r: [{name: "JIM", age: 31},{name: "MIMI", age: 21}] },

		{   n: 'injectL', 
            f: function(){ return _c.injectL(
					[{name: "Jim"},{name: "Mimi"}], 
					{
						rowclass: function(o,i){return i%2==0?'even':'odd'}
					}) }, 
            r: [{name: "Jim", rowclass: 'even'},{name: "Mimi", rowclass: 'odd'}] },
			
		{   n: 'clone', 
            f: function(){ return _c.clone([{name: "Mimi", nums: [1,2,3]}]) }, 
            r: [{name: "Mimi", nums: [1,2,3]}] },
			
		{   n: 'equal', 
            f: function(){ return _c.equal([{name: "Mimi", nums: [1,2,3]}], [{name: "Mimi", nums: [1,2,3]}]) }, 
            r: true }
	
        ]));
} 
</script>
<body>
<div><a href="index.html">index</a> <a href="#" onclick="test(); return false;">test</a></div>
<div id="main"></div>
</body>
</html>